package main

import (
	"context"
	"go-ms-scaffold/client/mss"
	"go-ms-scaffold/server/service/hello/pb/hello"
	"log"

	"google.golang.org/grpc"
	"google.golang.org/grpc/grpclog"
)

func main() {
	mss.GRPCClient("127.0.0.1:12345", func(conn *grpc.ClientConn) {
		client := hello.NewHelloClient(conn)
		request := &hello.HelloRequest{
			Name: "gRPC",
		}
		response, error := client.SayHello(context.Background(), request)
		if error != nil {
			grpclog.Fatalln(error)
		}
		log.Println(response.Message)
	})
}
